import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export const store = new Vuex.Store({
  // 定义状态
  state: {
    userInfo: {
      userName: 'admin',
      passWorld: '123456'
    }
  },
  mutations: {
    toLogin (state, msg) {
      state.userInfo = msg;
      console.log(state);
      console.log(msg);
    }
  }
});
